/**
 * Load entrance
 */

import { LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';

@customElement('lit-loader')
export class LitLoader extends LitElement {

    @property()
    private elements = '';

    private loadElements = () => {
        this.elements.split(',').forEach(_name => {
            // Dynamic load elements.
            import(/* webpackChunkName: '[request]' */ `./elements/${_name}/${_name}`);
        })
    }

    connectedCallback() {
        super.connectedCallback();

        this.loadElements();
    }
}